import { defineStore } from "pinia";
import { defaultMenus } from "@/router/modules/defaultMenus";
export const useRouterStore = defineStore("router", {
  state: () => ({
    //菜单显示路由(默认菜单路由+动态返回路由)
    menuRouter: [],
    //接口返回的路由，用于判断刷新时是否获取路由
    asyncRouter: [],
  }),
  actions: {
    saveAsyncRouter(data: any) {
      this.$state.asyncRouter = data;
      this.$state.menuRouter = defaultMenus.concat(data)
      console.log(14,defaultMenus.concat(data));
      
    },
  },
});
